package com.s666.demo.controller;

import com.s666.demo.service.KafkaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @author lijin
 */
@Controller
@RequestMapping("/kafka")
@Slf4j
public class KafkaProductController extends BaseController {

    private static final String TOPIC_NAME = "test";

    @Resource
    private KafkaService kafkaService;

    // /kafka/send
    @RequestMapping("/send")
    public String send() {
        kafkaService.product(TOPIC_NAME, 1);

        return "default/msg";
    }
}
